/**
 * org.assess.oa.system.action.TbDepartmentAction
 */
package org.assess.oa.system.action;

import org.assess.core.action.BaseAction;
import org.assess.oa.system.bean.TbDepartment;
import org.assess.oa.system.service.TbDepartmentService;

/**
 * @description 部门管理Action
 * @author XiaLongxiang
 * @createtime 2012-5-6 下午10:01:03
 */
public class TbDepartmentAction extends BaseAction {
    /** 序列化号 */
    private static final long serialVersionUID = 2460884269860992864L;
    
    private TbDepartment department;
    
    private TbDepartmentService tbDepartmentService;
    
    /**
     * 显示部门管理的JSP页面
     * @return
     */
    public String showDeptJsp() {
        return SUCCESS;
    }
    
    /**
     * 查询部门列表
     * @return
     */
    public String listDepartment() {
        String jsonString = tbDepartmentService.queryTbDepartmentAsList(department);
        super.setJsonString(jsonString);
        return SUCCESS;
    }
    
    /**
     * 加载部门列表
     * @return
     */
    public String listTbDepartmentAsStartPrior() {
        String jsonString = tbDepartmentService.queryTbDepartmentAsStartPrior(department);
        super.setJsonString(jsonString);
        return SUCCESS;
    }
    
    /**
     * 加载部门下拉树所需要的JSON数据
     * @return
     */
    public String listDepartmentAsJsonArray() {
        String jsonString = tbDepartmentService.queryDepartmentAsJsonArray(department);
        super.setJsonString(jsonString);
        return SUCCESS;
    }
    
    public TbDepartment getDepartment() {
        return department;
    }
    
    public void setDepartment(TbDepartment department) {
        this.department = department;
    }
    
    public void setTbDepartmentService(TbDepartmentService tbDepartmentService) {
        this.tbDepartmentService = tbDepartmentService;
    }
}
